import axios from '../request'

//登陆
export const loginApi = (username, password) => axios.post("/api/pub/v2/user/login", {
    "username": username,
    "password": password

})

export const creditCardSelectByPage = (page) => axios.get("/api/pub/v2/credit_card/selectByPage", {
    params: {
        "page": page

    }
})

export const creditCardDeleteById = (id) => axios.get("/api/pub/v2/credit_card/deleteById", {
    params: {

        "id": id
    }

})

export const creditCardInsert = (party, lawsuit_num, execute_num, sex, birth_date,
    nation, card_num, tel, home_address, current_address,
    work_address, principal, interest, amount, litigation_fee,
    declared_fee, lawyer_fee, credit_card, deadline_date, open_date,
    last_consume_date, last_pay_date, start_over_date, judge_principal, judge_interest,
    court_location, paper_sign_date, course, accuser, accuserPeople) => axios.post("/api/pub/v2/credit_card/insert", {
    "party": party,
    "lawsuitNum": lawsuit_num,
    "executeNum": execute_num,
    "sex": sex,
    "birthDate": birth_date,
    "nation": nation,
    "cardNum": card_num,
    "tel": tel,
    "homeAddress": home_address,
    "currentAddress": current_address,
    "workAddress": work_address,
    "principal": principal,
    "interest": interest,
    "amount": amount,
    "litigationFee": litigation_fee,
    "declaredFee": declared_fee,
    "lawyerFee": lawyer_fee,
    "creditCard": credit_card,
    "deadlineDate": deadline_date,
    "openDate": open_date,
    "lastPayDate": last_consume_date,
    "lastConsumeDate": last_pay_date,
    "startOverDate": start_over_date,
    "judgePrincipal": judge_principal,
    "judgeInterest": judge_interest,
    "courtLocation": court_location,
    "paperSignDate": paper_sign_date,
    "course": course,
    "accuser": accuser,
    "accuserPeople": accuserPeople
})

export const updateCreditCard = (id, party, lawsuit_num, execute_num, sex, birth_date,
    nation, card_num, tel, home_address, current_address,
    work_address, principal, interest, amount, litigation_fee,
    declared_fee, lawyer_fee, credit_card, deadline_date, open_date,
    last_consume_date, last_pay_date, start_over_date, judge_principal, judge_interest,
    court_location, paper_sign_date, course, accuser, accuserPeople) => axios.post("/api/pub/v2/credit_card/update", {
    "id": id,
    "party": party,
    "lawsuitNum": lawsuit_num,
    "executeNum": execute_num,
    "sex": sex,
    "birthDate": birth_date,
    "nation": nation,
    "cardNum": card_num,
    "tel": tel,
    "homeAddress": home_address,
    "currentAddress": current_address,
    "workAddress": work_address,
    "principal": principal,
    "interest": interest,
    "amount": amount,
    "litigationFee": litigation_fee,
    "declaredFee": declared_fee,
    "lawyerFee": lawyer_fee,
    "creditCard": credit_card,
    "deadlineDate": deadline_date,
    "openDate": open_date,
    "lastPayDate": last_consume_date,
    "lastConsumeDate": last_pay_date,
    "startOverDate": start_over_date,
    "judgePrincipal": judge_principal,
    "judgeInterest": judge_interest,
    "courtLocation": court_location,
    "paperSignDate": paper_sign_date,
    "course": course,
    "accuser": accuser,
    "accuserPeople": accuserPeople

})


//模糊查询 分页
export const findByNameOrKey = (key, page) => axios.get("/api/pub/v2/credit_card/findByNameOrKey", {
    params: {
        "key": key,
        "page": page

    }

})